find_package(MKL REQUIRED)
include_directories(${MKL_INCLUDE_DIRS})

find_package(MathLink REQUIRED)
include_directories(${MathLink_INCLUDE_DIRS})

find_package(HDF5 REQUIRED)
include_directories(${HDF5_INCLUDE_DIRS})

set(util_f90_src
        sample_data.F90
        polynomial_basis.F90
        data_fit.F90
        type_define.F90
        message.F90
        string.F90
        run_manager.F90
        file_io.F90
)

set(mathlink_c_src
        mathlink/mathlink_init.c
        mathlink/mathlink_findfit.c
        mathlink/mathlink_finalize.c
)

set(util_c_src
        ${mathlink_c_src}
)

add_library(util  ${util_f90_src} ${util_c_src})

set_source_files_properties(${util_c_src}
        PROPERTIES
        LANGUAGE C
)

target_link_libraries(util
	${MKL_LIBRARIES}
        ${MathLink_LIBRARIES}
        ${HDF5_LIBRARIES}
) 
